#include<bits/stdc++.h>
using namespace std;
int main(){
  freopen("hard.in","r",stdin);
  freopen("hard.out","w",stdout);
  ios::sync_with_stdio(false);
  cin.tie(0); cout.tie(0);
  int n; string a,b; cin>>n>>a>>b;
  vector<array<int,6> > f(n+1);
  f[0][1]=f[0][2]=f[0][3]=1,f[0][4]=f[0][5]=2;
  for(int i=1;i<=n;i++){
    if(a[i-1]!=b[i-1])f[i][3]=min({f[i-1][0]+1,f[i-1][1]+1,f[i-1][2]+1,f[i-1][3],f[i-1][4],f[i-1][5]}),f[i][0]=1e9;
    else f[i][0]=min({f[i-1][0],f[i-1][1],f[i-1][2],f[i-1][3],f[i-1][4],f[i-1][5]}),f[i][3]=1e9;
    if(b[i-1]&1)f[i][2]=min({f[i-1][0]+1,f[i-1][1]+1,f[i-1][2],f[i-1][3]+1,f[i-1][4]+1,f[i-1][5]}),f[i][1]=1e9;
    else f[i][1]=min({f[i-1][0]+1,f[i-1][1],f[i-1][2]+1,f[i-1][3]+1,f[i-1][4],f[i-1][5]+1}),f[i][2]=1e9;
    if(b[i-1]&1)f[i][4]=min({f[i-1][0]+2,f[i-1][1]+1,f[i-1][2]+2,f[i-1][3]+1,f[i-1][4],f[i-1][5]+1}),f[i][5]=1e9;
    else f[i][5]=min({f[i-1][0]+2,f[i-1][1]+2,f[i-1][2]+1,f[i-1][3]+1,f[i-1][4]+1,f[i-1][5]}),f[i][4]=1e9;
  }
  cout<<*min_element(f.back().begin(),f.back().end())<<endl;
  return 0;
}